package farm.pattern.factory;


import farm.entity.FarmMachine;
import farm.entity.SeederMachine;
import farm.entity.SprayerMachine;

public class ConcreteFarmMachineFactory extends FarmMachineFactory {
    @Override
    public FarmMachine createFarmMachine(String type) {
        switch (type) {
            case "播种机":
                return new SeederMachine();
            case "喷药机":
                return new SprayerMachine();
            default:
                throw new IllegalArgumentException("未知农机类型: " + type);
        }
    }
}